/**Name : main
 * Effect : 按需加载各模块
 */
requirejs.config({
    map:{'*': {css: 'lib/css.min'}},
    paths:{
        //text:['/js/lib/text'],
        jquery:['/js/lib/jquery.min'],
        bootstrap:['/js/lib/bootstrap/js/bootstrap.min'],
        bootstrapValidator:['/js/lib/bootstrap/js/bootstrapValidator.min'],
        bootstrapTable:['/js/lib/bootstrap/js/bootstrap-table.min'],
        bootstrapTableTreegrid:['/js/lib/bootstrap/js/bootstrap-table-treegrid'],
        bootstrapFileinput:['/js/lib/fileinput/js/fileinput.min'],
        fileInput:['/js/lib/fileinput/js/locales/zh'],
        jqueryTreegrid:['/js/lib/bootstrap/js/jquery.treegrid.min'],
        template:['/js/lib/template.min'],
        md5:['/js/lib/md5'],
        echarts:['/js/lib/echarts.min'],
        common:['/js/common'],
        page:['/js/lib/initPage'],
        layer:['/js/lib/layer/layer'],
        countUp:['/js/lib/countUp'],
        slimscroll:['/js/lib/jquery.slimscroll.min'],
        iCheck:['/js/lib/iCheck/icheck.min'],
        datepicker: ['/js/lib/datepicker/datepicker.min'],
        validate:['/js/lib/jquery.validate.min'],
        selectpicker:['/js/lib/select/bootstrapSelect.min'],
        datetimepicker:['/js/lib/datepicker/bootstrapDatetimepicker.min'],
        drawingManager: ['/js/lib/map/DrawingManager.min'],
        lushu: ['/js/lib/map/LuShu.min'],
        curveLine: ['/js/lib/map/curveLine']
    },
    shim: {
        'bootstrap':['jquery'],
        'slimscroll':['jquery'],
        'bootstrapTable':['bootstrap','css!/js/lib/bootstrap/css/bootstrap-table.min.css'],
        'bootstrapTableTreegrid':['bootstrapTable','css!/js/lib/bootstrap/css/jquery.treegrid.css'],
        'bootstrapFileinput':['css!/js/lib/fileinput/css/fileinput.min.css'],
        'jqueryTreegrid':['jquery'],
        'layer':['css!/js/lib/layer/layer.css'],
        'drawingManager': ['css!/js/lib/map/drawingmanager.css'],
        'iCheck': ['css!/js/lib/iCheck/flat/green.css'],
        'datepicker': ['css!/js/lib/datepicker/datepicker.min.css'],
        'selectpicker':['css!/js/lib/select/bootstrapSelect.min.css'],
        'datetimepicker':['css!/js/lib/datepicker/bootstrapDatetimepicker.min.css'],
        'fileInput':['bootstrapFileinput']
    },
    waitSeconds: 0,
    urlArgs: "version=v1.0"
});
require(['jquery','bootstrap'],function (){
    init();
    function init(){
        var routeId=$('.js-route-flag');
        // 登录、注册页加载
        if(routeId.hasClass('js-login')||routeId.hasClass('js-register')){
            require(['login'],function (login){
                login.init();
            });
        }
        // 主页
        if(routeId.hasClass('js-index')){
            require(['index'],function (index){
                index.init();
            });
        }
        // 统计分析
        if(routeId.hasClass('js-static')){
            require(['statics'],function (index){
                index.init();
            });
        }
        // 人流来源分布
        if(routeId.hasClass('js-comefrom')){
            require(['views/business/comeFrom'],function (index){
                index.init();
            });
        }
    }
});